#    Copyright 2008, 2009 Tri-County Electric Cooperative, St. Matthews, South Carolina
#    This file is part of COOPIP.
#    COOPIP is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#    COOPIP is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#    You should have received a copy of the GNU General Public License
#    along with COOPIP.  If not, see <http://www.gnu.org/licenses/>.


#************************BEGIN Add Include Files to Path************************
import sys
NeededPaths=['/opt/coopip/djangoproject/include', '/opt/coopip/djangoproject']
for path in NeededPaths:
    if(not path in sys.path):
        sys.path.append(path)
#************************END   Add Include Files to Path************************

from django.conf.urls.defaults import *
import views
import djangoproject

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',

    (r'^viewer/', 'djangoproject.views.Misc.MapViewer'),

    (r'^meterping/dispatch/', 'djangoproject.views.MeterPing.MeterPingDispatch'),
    (r'^meterping/display/amrfailure/', 'djangoproject.views.MeterPing.MeterPingDisplayAMRFailure'),
    (r'^meterping/display/substationfailure/', 'djangoproject.views.MeterPing.MeterPingDisplaySubstationFailure'),

    (r'^meterping/report/', 'djangoproject.views.MeterPing.MeterPingReport'),
    (r'^meterping/configuration/', 'djangoproject.views.MeterPing.Configuration'),
    (r'^meterping/clearamrtctinpq/', 'djangoproject.views.MeterPing.ClearAMRTctInpq'),
    (r'^meterping/', 'djangoproject.views.MeterPing.MainMenu'),

    
    (r'^meterblink/', 'djangoproject.views.Misc.BlinkCountReport'),
    (r'^meterblinkdetail/', 'djangoproject.views.Misc.BlinkCountReportDetail'),
    (r'^serverstatusupdate/(\S+)', 'djangoproject.views.ManagementConsole.ServerUpdate'),
    (r'^networkstatus/detail/', 'djangoproject.views.Misc.NetworkStatusDetail'),
    (r'^logout/', 'djangoproject.views.Misc.Logout'), 
    (r'^revenueprotection/logout/', 'djangoproject.views.RevenueProtection.Logout'),


    (r'^networkdevice/addedit/', 'djangoproject.views.NetworkDevice.AddEdit'),
    (r'^networkdevice/devicediagram/', 'djangoproject.views.NetworkDevice.ShowDiagram'),
    (r'^networkdevice/networkdeviceportconnectionaddedit/', 'djangoproject.views.NetworkDevicePortConnectionAddEdit'),
    (r'^networkdevice/networkdevicereport/', 'djangoproject.views.NetworkDeviceReport'),
    (r'^networkdevice/networkdeviceportconnectionreport/', 'djangoproject.views.NetworkDeviceConnectionReport'),
    (r'^test/', 'djangoproject.views.Misc.Test'),
    (r'^networkdevice/', 'djangoproject.views.NetworkDevice.MainMenu'),


    (r'^revenueprotection/meterinvestigation/', 'djangoproject.views.RevenueProtection.MeterInvestigation'),
    (r'^revenueprotection/searchinmeters/log/', 'djangoproject.views.RevenueProtection.SearchInMetersLog'),
    (r'^revenueprotection/searchinmeters/', 'djangoproject.views.RevenueProtection.SearchInMeters'),
    (r'^revenueprotection/searchmeterslists/', 'djangoproject.views.RevenueProtection.SearchMetersLists'),
    (r'^revenueprotection/searchmetersallcismeterslist/', 'djangoproject.views.RevenueProtection.SearchMetersAllCISMetersList'),

    (r'^revenueprotection/deletefromamr/', 'djangoproject.views.RevenueProtection.DeleteFromAMR'),

    (r'^revenueprotection/incident/file/(\d+)/', 'djangoproject.views.RevenueProtection.IncidentFileView'), 
    (r'^revenueprotection/incident/',   'djangoproject.views.RevenueProtection.Incident'), 
    (r'^revenueprotection/meterblink/', 'djangoproject.views.RevenueProtection.MeterBlinkView'),
    (r'^revenueprotection/rateclasscomparison/','djangoproject.views.RevenueProtection.RateClassComparison'),
    (r'^revenueprotection/report/getpdfreport/(\S+)', 'djangoproject.views.RevenueProtection.RevenueProtectionReportGetPDF'),
    (r'^revenueprotection/report/', 'djangoproject.views.RevenueProtection.RevenueProtectionReport'), 
    (r'^revenueprotection/viewvehiclehistory/',  'djangoproject.views.RevenueProtection.ViewVehicleHistory'),
    (r'^revenueprotection/failedmeterdata/',  'djangoproject.views.RevenueProtection.FailedMeterData'),
    (r'^revenueprotection/reportnote/', 'djangoproject.views.RevenueProtection.RevenueProtectionReportNote'),

    (r'^revenueprotection/', 'djangoproject.views.RevenueProtection.MainMenu'), 
    (r'^outdoorlightingbillingphase/', 'djangoproject.views.Misc.OutdoorLightingBillingPhaseTable'),

    #DISPATCH
    #display for large-format pages, view for standard, edit for content changed, data suffix for jquery wrapped displays
    (r'^dispatch/display/cameras/', 'djangoproject.views.Dispatch.DisplayCameras'),
    (r'^dispatch/display/map/', 'djangoproject.views.Dispatch.DisplayMap'),
    (r'^dispatch/display/messageboard/data/', 'djangoproject.views.Dispatch.DisplayMessageBoardData'),
    (r'^dispatch/display/messageboard/', 'djangoproject.views.Dispatch.DisplayMessageBoard'),
    (r'^dispatch/display/meterpingwithoutgroups/', 'djangoproject.views.Dispatch.DisplayMeterPingWithoutGroups'),

    (r'^dispatch/display/meterping/datawithoutgroups/', 'djangoproject.views.Dispatch.DisplayMeterPingDataWithoutGroups'),

    (r'^dispatch/display/meterping/data/', 'djangoproject.views.Dispatch.DisplayMeterPingData'),
    (r'^dispatch/display/meterping/', 'djangoproject.views.Dispatch.DisplayMeterPing'),
    (r'^dispatch/display/networkstatus/data/', 'djangoproject.views.Dispatch.NetworkStatusData'),
    (r'^dispatch/display/networkstatus/', 'djangoproject.views.Dispatch.NetworkStatus'),
    (r'^dispatch/display/outage/data/', 'djangoproject.views.Dispatch.DisplayOutageData'),
    (r'^dispatch/display/outage/', 'djangoproject.views.Dispatch.DisplayOutage'),

    (r'^dispatch/view/alarmhistory/', 'djangoproject.views.Dispatch.ViewAlarmHistory'),
    (r'^dispatch/view/cameras/SDO/', 'djangoproject.views.Dispatch.ViewCamerasSanteeRegion'),
    (r'^dispatch/view/cameras/SMO/', 'djangoproject.views.Dispatch.ViewCamerasStMatthewsRegion'),
    (r'^dispatch/view/cameras/RDO/', 'djangoproject.views.Dispatch.ViewCamerasRichlandRegion'),
    (r'^dispatch/view/cameras/', 'djangoproject.views.Dispatch.ViewCameras'),
    (r'^dispatch/view/crewloghistory/', 'djangoproject.views.Dispatch.ViewCrewLogHistory'),
    (r'^dispatch/view/map/', 'djangoproject.views.Dispatch.ViewMap'),
    

    (r'^dispatch/edit/alarms/', 'djangoproject.views.Dispatch.EditAlarms'),
    (r'^dispatch/edit/alarmcontacts/', 'djangoproject.views.Dispatch.EditAlarmContacts'),
    (r'^dispatch/edit/crewlogs/', 'djangoproject.views.Dispatch.EditCrewLogs'),
    (r'^dispatch/edit/outageassignment/', 'djangoproject.views.Dispatch.EditOutageAssignment'),
    (r'^dispatch/edit/messageboard/', 'djangoproject.views.Dispatch.EditMessageBoard'),
    (r'^dispatch/edit/vehicles/', 'djangoproject.views.Dispatch.EditVehicles'),
    (r'^dispatch/edit/dynamiccircuitassignment/', 'djangoproject.views.Dispatch.EditDynamicCircuitAssignments'),

    (r'^dispatch/', 'djangoproject.views.Dispatch.MainMenu'),


    #(r'^intranet/technology/', 'djangoproject.views.Intranet.Technology.MainMenu')

    (r'^report/serverstatus/', 'djangoproject.views.Misc.ServerStatus'),
    (r'^report/meterrateclass03demandreport', 'djangoproject.views.Report.MeterRateClass03DemandReport'),
    (r'^report/networkdeviceinventorycheck/', 'djangoproject.views.Report.NetworkDeviceInventoryCheck'),
    (r'^report/meterblinkrecent/', 'djangoproject.views.Report.MeterBlinkRecent'),
    (r'^report/warehousejunkedmeters/', 'djangoproject.views.Report.WarehouseJunkedMeters'),
    (r'^report/truckhistory/(\d+)/(\d+)/', 'djangoproject.views.Report.TruckHistory'),

    (r'^report/', 'djangoproject.views.Report.ReportMainMenu'),



    (r'^intranet/department/message/file/(\d+)/', 'djangoproject.views.Intranet.MessageFileView'), 
    (r'^intranet/department/message/', 'djangoproject.views.Intranet.Message'), #Department Pages for some to edit messages
    (r'^intranet/department/(\d+)/', 'djangoproject.views.Intranet.Department'),  #Department Pages for everyone to view



 #CIS Report Related Views
    (r'^cis/report/inactivecapitalcredit/', 'djangoproject.views.CISReport.InactiveCapitalCredit'),
    (r'^cis/report/activemetersbycounty/', 'djangoproject.views.CISReport.ActiveMetersByCounty'),
    (r'^cis/report/mailcodelist/', 'djangoproject.views.CISReport.MailCodeList'),
    (r'^cis/report/metertypesfromamr/', 'djangoproject.views.CISReport.MeterTypesFromAMR'),
    (r'^cis/report/ssnsearch/', 'djangoproject.views.CISReport.SSNSearch'),
    (r'^cis/report/idlemeter/', 'djangoproject.views.CISReport.IdleMeter'),
    (r'^cis/report/largebalanceactive/', 'djangoproject.views.CISReport.LargeBalanceActive'),
    (r'^cis/report/abnormalmeterreading/', 'djangoproject.views.CISReport.AbnormalMeterReading'),
    (r'^cis/report/operationroundup/', 'djangoproject.views.CISReport.OperationRoundupNumberOfMembers'),
    (r'^cis/report/meter/', 'djangoproject.views.CISReport.MeterReport'),
    (r'^cis/report/amrfixmetertype/', 'djangoproject.views.CISReport.AMRFixMeterType'),
    (r'^cis/report/meterspossiblynotjunked/', 'djangoproject.views.CISReport.CISMetersPossiblyNotJunked'),
    (r'^cis/report/rateswithtaxes/', 'djangoproject.views.CISReport.CISRatesWithTaxes'),
    (r'^cis/report/boldaccountnocheckmarks/', 'djangoproject.views.CISReport.CISReportBoldAccountNoCheckmarks'),
    (r'^cis/report/countymismatch/', 'djangoproject.views.CISReport.CISGISCountyMismatch'),
    (r'^cis/report/abnormalpenalty/', 'djangoproject.views.CISReport.CISReportAbnormalPenalty'),
    (r'^cis/report/oldmapnumbersforgeneration/', 'djangoproject.views.CISReport.OldMapNumbersForGeneration'),

    (r'^cis/report/outdoorlightingconversionoverview/', 'djangoproject.views.CISReport.OutdoorLightingConversionOverview'),
 

    (r'^cis/report/nationality/', 'djangoproject.views.CISReport.CISReportNationality'),
    (r'^cis/report/averagebill/', 'djangoproject.views.CISReport.CISReportAverageBill'),
    (r'^cis/report/ebillusers/', 'djangoproject.views.CISReport.CISReportEbillUsers'),
    (r'^cis/report/invalidboarddistrict/', 'djangoproject.views.CISReport.CISReportInvalidBoardDistrict'),
    (r'^cis/report/annualmeetingmailinglabel/', 'djangoproject.views.CISReport.CISReportAnnualMeetingMailingLabel'),
    (r'^cis/report/prepaidmeterswithcollars/', 'djangoproject.views.CISReport.CISReportPrepaidMetersWithCollars'),
    (r'^cis/report/constantbills/', 'djangoproject.views.CISReport.CISReportConstantBills'),
    (r'^cis/report/populateoptimumreference/', 'djangoproject.views.CISReport.PopulateOptimumObjectReference'),
    (r'^cis/report/residentialsurvey2012/', 'djangoproject.views.CISReport.ResidentialSurvey2012'), 
    (r'^cis/report/barcode/', 'djangoproject.views.CISReport.CISReportBarcode'),
    (r'^cis/report/cisreportcheckbychecknumber/', 'djangoproject.views.CISReport.CISReportCheckByCheckNumber'),
    (r'^cis/report/cisreportcapitalcreditswithdeadpatron/', 'djangoproject.views.CISReport.CISCapitalCreditsWithDeadPatron'),
    (r'^cis/report/cisreportadjustmentdetails/test/', 'djangoproject.views.CISReport.CISReportAdjustmentDetailsTest'),

    (r'^cis/report/cisreportadjustmentdetails/', 'djangoproject.views.CISReport.CISReportAdjustmentDetails'),

    (r'^cis/report/outdoorlightingconversionreport/', 'djangoproject.views.CISReport.CISReportOutdoorLightingConversion'),



    (r'^cis/', 'djangoproject.views.CISReport.MainMenu'),

    (r'^gis/report/amrgisunmatchedcircuits/', 'djangoproject.views.GISReport.AMRGISUnmatchedCircuits'),
    (r'^gis/report/gisundoamrunmatchedcircuits/', 'djangoproject.views.GISReport.GISUndoAMRUnmatchedCircuits'),
    (r'^gis/report/gisreportamrunmatchedcircuits/', 'djangoproject.views.GISReport.GISReportAMRUnmatchedCircuits'),
    (r'^gis/report/fixunmatchedgislocations/', 'djangoproject.views.GISReport.FixUnmatchedGISLocations'),
    (r'^gis/report/fixmovedgismeters/', 'djangoproject.views.GISReport.FixMovedGISMeters'),
    (r'^gis/report/amrphaseupdatenochanges/', 'djangoproject.views.GISReport.AMRPhaseUpdateNoChanges'),
    (r'^gis/report/amrphaseupdate/', 'djangoproject.views.GISReport.AMRPhaseUpdate'),
    (r'^gis/report/substationpeakamps/', 'djangoproject.views.GISReport.SubstationPeakAmps'),
    (r'^gis/report/amrmeterswithcircuitinfo/', 'djangoproject.views.GISReport.AMRMetersWithCircuitInfo'),
    (r'^gis/report/updatecircuitnamesfromamr/', 'djangoproject.views.GISReport.UpdateCircuitNamesFromAMR'),
    (r'^gis/report/gisundoamrunmatchedcircuitsnochanges', 'djangoproject.views.GISReport.GISUndoAMRUnmatchedCircuitsNoChanges'),

    (r'^gis/report/transformerusageanalysis/', 'djangoproject.views.GISReport.TransformerUsageAnalysisView'), 
    (r'^gis/', 'djangoproject.views.GISReport.MainMenu'),

    (r'^amr/report/highestusage/', 'djangoproject.views.AMRReport.HighestUsage'), 
    (r'^amr/report/invalidcyclenumbers/', 'djangoproject.views.AMRReport.InvalidCycleNumbers'),
    (r'^amr/report/substationsofflinetextonly/', 'djangoproject.views.AMRReport.SubstationsOfflineTextOnly'),
    (r'^amr/report/recentmeterreads/', 'djangoproject.views.AMRReport.RecentMeterReads'),
    (r'^amr/report/prepaidconsecutivepending/', 'djangoproject.views.AMRReport.PrepaidConsecutivePendingReads'),

    (r'^amr/', 'djangoproject.views.AMRReport.MainMenu'),

    #COOPTALK related views
    (r'^cooptalk/testharness/', 'djangoproject.views.COOPTalk.COOPTalkTestHarness'),
    (r'^cooptalk/meterread/(\d+)/', 'djangoproject.views.COOPTalk.COOPTalkOutInitiateMeterReadByMeterNumber'),
    (r'^cooptalk/getmeterread/(\d+)/', 'djangoproject.views.COOPTalk.COOPTalkOutGetMeterReadByMeterNumber'),
    (r'^cooptalk/viewlog/', 'djangoproject.views.COOPTalk.COOPTalkViewLog'),
    (r'^cooptalk/', 'djangoproject.views.COOPTalk.COOPTalkView'),


    (r'^', 'djangoproject.views.Intranet.index'),
    (r'^admin/', include(admin.site.urls)),    
    (r'^', 'djangoproject.views.Intranet.index'),
)

